user fullName

Hi all,

something what's puzzling me:
in all my scripts I include a script that sends me an email when the original script is being executed, telling me the script name, project name and name of user.
The username I extract using

User u = find() 
string name = u.fullName


This used to work just fine until yesterday.
Now I have three new scripts (written by someone else) that generate the DXL error:

<checkUsage.inc:31> incorrect use of identifier (fullName)

but for the life of me I cannot find why.

Any ideas?

Karl


kabr - Tue Oct 23 11:31:43 EDT 2012

Re: user fullName
SystemAdmin - Tue Oct 23 12:28:25 EDT 2012

karl;

Try using 'doorsname' in place of u.fullName...don't know why but this is what I found in the DXL reference manual on 9.1

username
Declaration
string username()
Operation
Returns a string that contains the operating system defined user name under which Rational DOORS is being run. This may not be the same as the Rational DOORS user name returned by doorsname, depending on the current project's setup.

Re: user fullName
llandale - Tue Oct 23 16:38:11 EDT 2012

It appears those scripts define variable "fullName" for something. Try this kluge:
  • User u = find()
  • string name = u.(UserElement_ fullName)
  • print name

-Louie

Re: user fullName
kabr - Wed Oct 24 09:11:53 EDT 2012

Thanks, Bill and Louie for your responses!

@Bill:
'doorsname' is identical with 'username' in our case, but not 'fullName'. so no help.

@Louie:
string name = u.(UserElement_ fullName)
unfortunately does not work
but I believe your guess is correct that "fullName" is being used differently in another script:
the new scripts include three files from \lib\dxl\example
if I comment these out then there is no error message (but the script does not run of course)
when I put my include statement before these then there is no error message and the script runs correctly.

so again, the order of includes is crucial.
but, strange strange, some of my older scripts also include the files from \lib\dxl\example, but there I don't get the error.

8-\

Re: user fullName
llandale - Wed Oct 24 16:20:31 EDT 2012

kabr - Wed Oct 24 09:11:53 EDT 2012
Thanks, Bill and Louie for your responses!

@Bill:
'doorsname' is identical with 'username' in our case, but not 'fullName'. so no help.

@Louie:
string name = u.(UserElement_ fullName)
unfortunately does not work
but I believe your guess is correct that "fullName" is being used differently in another script:
the new scripts include three files from \lib\dxl\example
if I comment these out then there is no error message (but the script does not run of course)
when I put my include statement before these then there is no error message and the script runs correctly.

so again, the order of includes is crucial.
but, strange strange, some of my older scripts also include the files from \lib\dxl\example, but there I don't get the error.

8-\

Try:
  • string name = u.(UserElement_ fullName())
I see that include\hierarchy.inc therein does define function:
  • string fullName(string)
and that seems to be the culprit when I include it and try your code.

I'm too ignorant to even guess why that would mess up the function
  • UserElement_ userName()

-Louie

This is one of those "serenity" situations I've paid $1000s of dollars with my therapist about!

Re: user fullName
kabr - Tue Nov 20 04:26:53 EST 2012

llandale - Wed Oct 24 16:20:31 EDT 2012
Try:

  • string name = u.(UserElement_ fullName())
I see that include\hierarchy.inc therein does define function:
  • string fullName(string)
and that seems to be the culprit when I include it and try your code.

I'm too ignorant to even guess why that would mess up the function
  • UserElement_ userName()

-Louie

This is one of those "serenity" situations I've paid $1000s of dollars with my therapist about!

That does it, Louie.

Thank you very much!

Karl

Re: user fullName
meinhana - Thu Feb 25 04:44:00 EST 2016

Try

User u = find()
string n = u.name

print n "\n"